<?php
/**
 * Template Name: Page Introduction
 * 
 */
get_header();
?>
	<section class="main">
		<nav class="main-nav">
			<ul>						
				<?php 
					$taxonomies = 'building-type';
					$args  = array('hide_empty'=>false);
					$terms = get_terms( $taxonomies, $args ) ;
					foreach($terms as $term){							
						if( $term->parent == 0 && get_tax_meta($term->term_id,'building_tax_show_home') == 1){
							?>
						<li <?php echo checkActiveMenuHome($term->term_id)?>><a href="<?php echo get_term_link($term,$taxonomies);?>"><?php echo $term->name;?></a></li>
						<li class="line-nav"></li>
					<?php
						}
					}
				?>
				<?php $pageid = 58 ;if(ICL_LANGUAGE_CODE == 'vi') $pageid = 76 ;?>
			   <li><a href="<?php echo get_page_link($pageid)?>">
					<?php echo get_page($pageid)->post_title; ?>
				</a></li>
			</ul>
		</nav>
    	<?php get_sidebar(); ?>        
        <!-- main content -->
        <section class="main-content">
			<section class="discrumble">
				<?php if(function_exists('bcn_display')){ bcn_display();}?>
			</section>			
			<section class="col-main">
				<article class="detail">
					<?php if(have_posts()){
							while(have_posts()) { the_post();
								the_content();
							}
					}?>		
					<div class="contact-company">
						<h3 class="des-title"><?php _e('Contact with us','building');?></h3>
						<ul class="list-er">
							<?php
								$users = get_users('orderby=nicename');
								foreach($users as $user){
							?>
							<li>
								<h4 class="img-er">
									<?php if($user->image == ''):
										echo get_avatar( get_the_author_meta( $user->ID ), 190 );
									?>	
									<?php else: ?>
										<img alt="<?php echo $user->user_nicename?>" src="<?php echo $user->image?>" style="max-width: 100%;">
									<?php endif;?>
								</h4>
								<h3 class="name-er">
									<a href="<?php echo get_bloginfo('url');?>/author/<?php echo $user->user_nicename;?>"><?php echo $user->user_nicename?></a>
								</h3>
								<p>
									<strong><?php _e('Mobile:','building')?></strong>
									<?php echo $user->mobile;?>
								</p>
								<p>
									<strong><?php _e('Properties:','building')?></strong>
									<?php echo count_user_posts_by_type($user->ID,'building');?>
								</p>
								<p>
									<a href="<?php echo get_bloginfo('url');?>/author/<?php echo $user->user_nicename;?>"><?php _e('Contact with Agent','building')?></a>
								</p>
							</li>
							<?php
								}
							?>
						</ul>
					</div>
				</article>
			</section>
        </section>
        <!-- end main content -->
        <div class="clear"></div>
    </section>
    <!-- content -->
<?php get_footer(); ?>